#ifndef __UNIT_ELEMENT_VIEW_H__
#define __UNIT_ELEMENT_VIEW_H__

#include "gofgame/common/Ref.h"
#include "gofgame/common/resource/HornedTextureBrushResource.h"
#include "gofgame/common/ui/Container.h"
#include "gofgame/common/ui/DialogClosedEventArgs.h"
#include "gofgame/common/ui/Image.h"
#include "gofgame/common/ui/Label.h"
#include "gofgame/common/ui/Button.h"
#include "gofgame/dungeonkeeper/game/UnitType.h"
#include "gofgame/dungeonkeeper/game/unit/UnitManager.h"
#include "gofgame/common/resource/TextureResource.h"

using namespace gofgame::dungeonkeeper::game::unit;

namespace gofgame {
	namespace dungeonkeeper {
		namespace ui {

			using namespace gofgame::common;
			using namespace gofgame::common::resource;
			using namespace gofgame::common::ui;
			using namespace gofgame::dungeonkeeper::game::unit;

			class UnitElementView : public Container {
			public:
				virtual bool init() _override;
				virtual UnitElementViewInfo getUnitElementViewInfo() const;
				virtual void setUnitElementViewInfo(const UnitElementViewInfo &uvi);

			protected:
				Ref<Image> image;
				Ref<Label> nameLabel;
				Ref<Label> hpLabel;
				Ref<Label> menaLabel;
				Ref<Label> attackLabel;
				Ref<Label> defLabel;
				Ref<Label> speedLabel;
				Ref<Label> attackSpeedLabel;
				Ref<Label> priceLabel;
				Ref<Label> descriptionLabel;
				Ref<Button> upgradeButton;
				UnitType unitType;
				static HornedTextureBrushResource elementBrushResource;
				static TextureResource hpIconResource;
				static TextureResource attackIconResource;
				static TextureResource defIconResource;
				static TextureResource priceIconResource;

			private:
				void upgradeButton_click(void *sender, ComponentEventArgs &e);
				void upgradeConfirmDialog_close(void* sender, DialogClosedEventArgs &e);
			};
		}
	}
}

#endif //__UNIT_ELEMENT_VIEW_H__
